import json

import requests

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
    'Cookie': 'JSESSIONID=21AB52A8662379AA9517A40848E00236; access_cookie=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiIxMDAwMDEyNzI4IiwiY3JlYXRlRGF0ZUxvbmciOjE2NDc4NDY3NjIzMDh9.g8PehAa7ysMbkrcExHarOTvJ1Q3pqaLFzoVCK6HfoSI; refreshtoken_cookie=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiIxMDAwMDEyNzI4IiwiY3JlYXRlRGF0ZUxvbmciOjE3MDYxNjYxODc0OTh9.vgalz8Ac077OteGFgCeQgd4QJoaPFVsaRJ_sCb7KwCg'
}


# 批量导入人员信息
# batch_import_of_personnel_information
def ImportVisitorApplyData(filename, cookies):
    url = 'http://10.25.141.134:9188/customerservice/uploadfile'
    data = {
        'file':" open(filename, 'rb')",
        'file_id': 0,
        'uploadType': 'infoCollect',
        'fileName': None,
    }
    response = requests.post(url, json=data)
    result = response.text
    print(result)


if __name__ == '__main__':
    f = '../入园清单-规划部.xlsx'
    ImportVisitorApplyData(f, 1)
